<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>计算属性</title>
  <script src='vue/vue.js'></script>
</head>

<body>
  <div id="app">
    <div>{{fullName}}</div>
</div>
  <script>
    var vm = new Vue({
      el:"#app",
      data:{
        firstName: 'tan',
        lastNme: 'yp'
      },
      computed: {
        fullName: {
          get:function(){
            console.log('get');
            return this.firstName + " " + this.lastNme
          },
          set:function(fullName){
            console.log('set');
            return this.firstName + " " + this.lastNme
          }
        }
      }
    })
  </script>
</body>

</html>